import random
import time

account = 1000
buycar = []
shopinventory = ['噬神者之书','破军','红莲斗篷','霸者重装','极影','痛苦面具']
'''
噬神者之书200元:a
破军400元:b
红莲斗篷392元:c
霸者重装234元:d
极影244元:e
痛苦面具231元:f
'''
a = 200
b = 400
c = 392
d = 234
e = 244
f = 231
discount = random.randint(1,10)
if discount == 1:
    a *= 0.1
    b *= 0.1
    c *= 0.1
    d *= 0.1
    e *= 0.1
    f *= 0.1
    print("你抽到了1折优惠券")
if discount == 2:
    a *= 0.2
    b *= 0.2
    c *= 0.2
    d *= 0.2
    e *= 0.2
    f *= 0.2
    print("你抽到了2折优惠券")
if discount == 3:
    a *= 0.3
    b *= 0.3
    c *= 0.3
    d *= 0.3
    e *= 0.3
    f *= 0.3
    print("你抽到了3折优惠券")
if discount == 4:
    a *= 0.4
    b *= 0.4
    c *= 0.4
    d *= 0.4
    e *= 0.4
    f *= 0.4
    print("你抽到了4折优惠券")
if discount == 5:
    a *= 0.5
    b *= 0.5
    c *= 0.5
    d *= 0.5
    e *= 0.5
    f *= 0.5
    print("你抽到了5折优惠券")
if discount == 6:
    a *= 0.6
    b *= 0.6
    c *= 0.6
    d *= 0.6
    e *= 0.6
    f *= 0.6
    print("你抽到了6折优惠券")
if discount == 10:
    print("运气真差，啥优惠也没有")
if discount == 7:
    a *= 0.7
    b *= 0.7
    c *= 0.7
    d *= 0.7
    e *= 0.7
    f *= 0.7
    print("你抽到了7折优惠券")
if discount == 8:
    a *= 0.8
    b *= 0.8
    c *= 0.8
    d *= 0.8
    e *= 0.8
    f *= 0.8
    print("你抽到了8折优惠券")
if discount == 9:
    a *= 0.9
    b *= 0.9
    c *= 0.9
    d *= 0.9
    e *= 0.9
    f *= 0.9
    print("你抽到了9折优惠券")
totalMoney = 0
while account > 0 :
    buyfront = str(input("你要买什么："))
    exist = buyfront in shopinventory
    if exist :
        print("买了")
        buycar.append(buyfront)
        if buyfront == '噬神者之书':
            account -= a
            totalMoney += a
            if account < 0:
                print("钱不够了")
                break
            else:
                droppay = str(input("您是否需要退货？请输入y/n:"))
                if droppay == 'y':
                    tui = input(print("告诉我你要退什么："))
                    if tui == '破军':
                        account += b
                        buycar.remove('破军')
                    if tui == '噬神者之书':
                        account += a
                        buycar.remove('噬神者之书')
                    if tui == '红莲斗篷':
                        account += c
                        buycar.remove('红莲斗篷')
                    if tui == '极影':
                        account += e
                        buycar.remove('极影')
                    if tui == '痛苦面具':
                        account += f
                        buycar.remove('痛苦面具')
                    if tui == '霸者重装':
                        account += d
                        buycar.remove('霸者重装')
                    else:
                        print("看来您不想退")
                print("卡里还有：",account)
                print("你还买吗？")
                quest = str(input(""))
                if quest == '不买':
                    break

        elif buyfront == '破军':
            account -= b
            totalMoney += b
            if account < 0:
                print("钱不够了")
                break
            else:
                droppay = str(input("您是否需要退货？请输入y/n:"))
                if droppay == 'y':
                    tui = input(print("告诉我你要退什么："))
                    if tui == '破军':
                        account += b
                        buycar.remove('破军')
                    if tui == '噬神者之书':
                        account += a
                        buycar.remove('噬神者之书')
                    if tui == '红莲斗篷':
                        account += c
                        buycar.remove('红莲斗篷')
                    if tui == '极影':
                        account += e
                        buycar.remove('极影')
                    if tui == '痛苦面具':
                        account += f
                        buycar.remove('痛苦面具')
                    if tui == '霸者重装':
                        account += d
                        buycar.remove('霸者重装')
                    else:
                        print("看来您不想退")
                print("卡里还有：",account)
                print("你还买吗？")
                quest = str(input(""))
                if quest == '不买':
                    break
        elif buyfront == '红莲斗篷':
            account -= c
            totalMoney += c
            if account < 0:
                print("钱不够了")
                break
            else:
                droppay = str(input("您是否需要退货？请输入y/n:"))
                if droppay == 'y':
                    tui = input(print("告诉我你要退什么："))
                    if tui == '破军':
                        account += b
                        buycar.remove('破军')
                    if tui == '噬神者之书':
                        account += a
                        buycar.remove('噬神者之书')
                    if tui == '红莲斗篷':
                        account += c
                        buycar.remove('红莲斗篷')
                    if tui == '极影':
                        account += e
                        buycar.remove('极影')
                    if tui == '痛苦面具':
                        account += f
                        buycar.remove('痛苦面具')
                    if tui == '霸者重装':
                        account += d
                        buycar.remove('霸者重装')
                    else:
                        print("看来您不想退")
                print("卡里还有：", account)
                print("你还买吗？")
                quest = str(input(""))
                if quest == '不买':
                    break
        elif buyfront == '霸者重装':
            account -= d
            totalMoney += d
            if account < 0:
                print("钱不够了")
                break
            else:
                droppay = str(input("您是否需要退货？请输入y/n:"))
                if droppay == 'y':
                    tui = input(print("告诉我你要退什么："))
                    if tui == '破军':
                        account += b
                        buycar.remove('破军')
                    if tui == '噬神者之书':
                        account += a
                        buycar.remove('噬神者之书')
                    if tui == '红莲斗篷':
                        account += c
                        buycar.remove('红莲斗篷')
                    if tui == '极影':
                        account += e
                        buycar.remove('极影')
                    if tui == '痛苦面具':
                        account += f
                        buycar.remove('痛苦面具')
                    if tui == '霸者重装':
                        account += d
                        buycar.remove('霸者重装')
                    else:
                        print("看来您不想退")
                print("卡里还有：", account)
                print("你还买吗？")
                quest = str(input(""))
                if quest == '不买':
                    break
        elif buyfront == '极影':
            account -= e
            totalMoney += e
            if account < 0:
                print("钱不够了")
                break
            else:
                droppay = str(input("您是否需要退货？请输入y/n:"))
                if droppay == 'y':
                    tui = input(print("告诉我你要退什么："))
                    if tui == '破军':
                        account += b
                        buycar.remove('破军')
                    if tui == '噬神者之书':
                        account += a
                        buycar.remove('噬神者之书')
                    if tui == '红莲斗篷':
                        account += c
                        buycar.remove('红莲斗篷')
                    if tui == '极影':
                        account += e
                        buycar.remove('极影')
                    if tui == '痛苦面具':
                        account += f
                        buycar.remove('痛苦面具')
                    if tui == '霸者重装':
                        account += d
                        buycar.remove('霸者重装')
                    else:
                        print("看来您不想退")
                print("卡里还有：", account)
                print("你还买吗？")
                quest = str(input(""))
                if quest == '不买':
                    break
        elif buyfront == '痛苦面具':
            account -= f
            totalMoney += f
            if account < 0:
                print("钱不够了")
                break
            else:
                droppay = str(input("您是否需要退货？请输入y/n:"))
                if droppay == 'y':
                    tui = input(print("告诉我你要退什么："))
                    if tui == '破军':
                        account += b
                        buycar.remove('破军')
                    if tui == '噬神者之书':
                        account += a
                        buycar.remove('噬神者之书')
                    if tui == '红莲斗篷':
                        account += c
                        buycar.remove('红莲斗篷')
                    if tui == '极影':
                        account += e
                        buycar.remove('极影')
                    if tui == '痛苦面具':
                        account += f
                        buycar.remove('痛苦面具')
                    if tui == '霸者重装':
                        account += d
                        buycar.remove('霸者重装')
                    else:
                        print("看来您不想退")
                print("卡里还有：", account)
                print("你还买吗？")
                quest = str(input(""))
                if quest == '不买':
                    break
    else:
        print("没有")
        break
if buycar == [] :
    print("没买东西")
else:
    print("购物车里有：",buycar)
    print("总价有：",totalMoney)
current_date = time.strftime("%Y-%m-%d", time.localtime())
print(current_date)
